﻿namespace Grove.Cards.Usg
{
	using System.Collections.Generic;
	using Grove.Core;
	using Grove.Core.Ai;
	using Grove.Core.Details.Cards;
	using Grove.Core.Details.Cards.Effects;
	using Grove.Core.Details.Cards.Modifiers;
	using Grove.Core.Dsl;
	using Grove.Core.Targeting;

	public class VinesOfVastwood : CardsSource
  {
    public override IEnumerable<ICardFactory> GetCards()
    {
      yield return C.Card
        .Named("Vines of Vastwood")
        .ManaCost("{G}")
        .KickerCost("{G}")
        .Type("Instant")
        .InSets("Urza's Saga")
        .Category(EffectCategories.Protector | EffectCategories.ToughnessIncrease)
        .Timing(Timings.NoRestrictions())
        .Text(
          "{Kicker} {G}{EOL}Target creature can't be the target of spells or abilities your opponents control this turn. If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn.")
        .Effect<ApplyModifiersToTargets>(p => p.Effect.Modifiers(
          p.Builder.Modifier<AddStaticAbility>((m, _) => m.StaticAbility = Static.Hexproof, untilEndOfTurn: true)))
        .Targets(
          selectorAi: TargetSelectorAi.ShieldHexproof(),
          effectValidator: C.Validator(Validators.Creature()))
        .KickerEffect<ApplyModifiersToTargets>(p => p.Effect.Modifiers(
          p.Builder.Modifier<AddStaticAbility>((m, _) => m.StaticAbility = Static.Hexproof, untilEndOfTurn: true),
          p.Builder.Modifier<AddPowerAndToughness>((m, _) =>
            {
              m.Power = 4;
              m.Toughness = 4;
            }, untilEndOfTurn: true)))
        .KickerTargets(
          aiTargetSelector: Any(TargetSelectorAi.ShieldHexproof(), TargetSelectorAi.IncreasePowerAndToughness(4, 4)),
          effectValidators: C.Validator(Validators.Creature()));
    }
  }
}